core: Return input stream for raw repositories too
authorColin Walters <walters@verbum.org>
Mon, 2 Apr 2012 21:40:17 +0000 (17:40 -0400)
committerColin Walters <walters@verbum.org>
Mon, 2 Apr 2012 22:32:40 +0000 (18:32 -0400)
This bug is more obvious when fsck is rebased on top of
ostree_repo_load_file().

src/libostree/ostree-repo.c

index 69e4207b690b3fa318a7c40696c01e14e98a35b2..aeb7346b199e6c6bdcae6f07c598ed9a4e5d0c52 100644 (file)
@@ -3274,6 +3274,15 @@ ostree_repo_load_file (OstreeRepo         *self,
                                          G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, cancellable, error);
       if (!ret_file_info)
         goto out;
+
+      /* Now, look for the content */
+      if (g_file_info_get_file_type (ret_file_info) == G_FILE_TYPE_REGULAR
+          && out_input)
+        {
+          ret_input = (GInputStream*)g_file_read (content_loose_path, cancellable, error);
+          if (!ret_input)
+            goto out;
+        }
       if (out_xattrs)
         {
           ret_xattrs = ostree_get_xattrs_for_file (content_loose_path, error);